import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.http.*;

public class Login extends HttpServlet
{
	 public void doPost(HttpServletRequest request, HttpServletResponse response)
    {
           processRequest(request,response);
    }
  public void doGet(HttpServletRequest request, HttpServletResponse response)
  {
	      processRequest(request,response);
  }
   public void processRequest(HttpServletRequest request, HttpServletResponse response)
  {
    try
     {
       //PrintWriter out=response.getWriter();
       //response.setContentType("text/html");
       
	   String s=request.getParameter("uname");
       String n = request.getParameter("pass");
       	if(isAuthenticate(s,n))
			response.sendRedirect("Inbox.html");
		else
			response.sendRedirect("Error.html");
	  
     }catch(Exception e)
      {
         //out.println(e.toString());
      }
  }
  private boolean isAuthenticate(String uid,String pass)
 {
    if(uid.equals("jabu") && pass.equals("j1234"))
		return true;
	else
		return false;
 }
}
